{extend name="common/layout" /}
{block name="head"}
  <style type="text/css">
    .input-mid{width: 80px;text-align: center;background: #00b9da;color: #fff;border-radius: 10px;margin-left: -30px;height: 25px;line-height: 25px;z-index: 1;}
    .input-margin10{margin-left: -16px;}
  </style>
{/block}
{block name="main"}
<div class="admin-main fadeInUp animated" ng-app="hd" ng-controller="ctrl">
    <div class="padding30">
      <h3 class="page-box-title">{:lang('New Configuration')}</h3>
     </div>
     <div class="layui-form-box" style="width: 700px;">
    <form class="layui-form ">
        <input type="hidden" name="id" value="{$row['id']}">
       
        <div class="layui-form-item">
            <label class="layui-form-label layui-form-label10">{:lang('Type')}</label>
            <div class="layui-input-6">
               <select name="type" disabled="" data-title="{:lang('Please Choose')}" >
                    <option value="">{:lang('Please Choose')}</option>
                    <?php foreach($typeList as $type=>$typeLabel):?>
                    <option value="{$type}" <?php if($row['type'] == $type){echo "selected"; }?>>{$typeLabel}</option>
                    <?php endforeach;?>
              </select>
            </div>
           
         </div>
          <div class="layui-form-item">
          <div class="layui-inline">
            <label class="layui-form-label layui-form-label10">{:lang('broadband')}</label>
            <div class="layui-input-inline" style="width: 183px;">
              <input type="text" name="min_mbps" lay-verify="number" value="{$row['min_mbps']}" placeholder="{:lang('field_min_mbps')}" autocomplete="off" class="layui-input">
            </div>
            <div class="layui-form-mid input-mid">-</div>
            <div class="layui-input-inline" style="width: 183px;">
              <input type="text" name="max_mbps"  lay-verify="number"  value="{$row['max_mbps']}" placeholder="{:lang('field_max_mbps')}" autocomplete="off" class="layui-input input-margin10">
            </div>
          </div>
        </div>
        <?php if($row['type'] == 3 || $row['type'] == 8 ):?>
        <!--地区-->
        <div class="areaBlcok"> 
            <div class="layui-form-item">
              <label class="layui-form-label layui-form-label10">{:lang('A End')}</label>
              <div class="layui-input-inline">
                   <input type="text" name="" disabled="" value="Hong Kong" autocomplete="off" class="layui-input">
              </div>
          </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-label10">{:lang('Z End')}</label>
                <div class="layui-input-inline">
                  <input type="text" name="" disabled="" value="{:getCountryOrCityName($row['country_id'])}" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid input-mid">-</div>
                <div class="layui-input-inline">
                   <input type="text" name="" disabled="" value="{:getCountryOrCityName($row['city_id'])}" autocomplete="off" class="layui-input">
                </div>
             </div>
        </div>
    <?php endif;?>
        <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label layui-form-label10">{:lang('Monthly')}</label>
              <div class="layui-input-inline" style="width: 183px;">
                <input type="text" name="rmb1" placeholder="￥" value="{$row['rmb1']}" data-title="{:lang('Please enter the number')}" lay-verify="price" autocomplete="off" class="layui-input">
              </div>
              <div class="layui-form-mid input-mid">{:lang('RMB/Month')}　</div>
              <div class="layui-input-inline" style="width: 183px;">
                <input type="text" name="usd1" placeholder="USD" value="{$row['usd1']}"  lay-verify="price" autocomplete="off" class="layui-input input-margin10">
              </div>
              <div class="layui-form-mid" style="color: #888;">{:lang('USD/Month')}</div>
            </div>
          </div>
        <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label layui-form-label10">{:lang('Quarter')}</label>
              <div class="layui-input-inline" style="width: 183px;">
                <input type="text" name="rmb3" placeholder="￥" lay-verify="price" value="{$row['rmb3']}"  autocomplete="off" class="layui-input">
              </div>
              <div class="layui-form-mid input-mid">{:lang('RMB/Month')}　</div>
              <div class="layui-input-inline" style="width: 183px;">
                <input type="text" name="usd3" placeholder="USD" lay-verify="price" value="{$row['usd1']}"  autocomplete="off" class="layui-input input-margin10">
              </div>
              <div class="layui-form-mid" style="color: #888;">{:lang('USD/Month')}</div>
            </div>
          </div>  
        <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label layui-form-label10">{:lang('Semiannual')}</label>
              <div class="layui-input-inline" style="width: 183px;">
                <input type="text" name="rmb6" lay-verify="price" placeholder="￥" value="{$row['rmb6']}"  autocomplete="off" class="layui-input ">
              </div>
              <div class="layui-form-mid input-mid">{:lang('RMB/Month')}　</div>
              <div class="layui-input-inline" style="width: 183px;">
                <input type="text" name="usd6" placeholder="USD" lay-verify="price" value="{$row['usd6']}"  autocomplete="off" class="layui-input input-margin10">
              </div>
              <div class="layui-form-mid" style="color: #888;">{:lang('USD/Month')}</div>
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label layui-form-label10">{:lang('Year')}</label>
              <div class="layui-input-inline" style="width: 183px;">
                <input type="text" name="rmb12" placeholder="￥" lay-verify="price" autocomplete="off" value="{$row['rmb12']}"  class="layui-input">
              </div>
              <div class="layui-form-mid input-mid">{:lang('RMB/Month')}　</div>
              <div class="layui-input-inline" style="width: 183px;">
                <input type="text" name="usd12" placeholder="USD" lay-verify="price" autocomplete="off" value="{$row['usd12']}" class="layui-input input-margin10">
              </div>
              <div class="layui-form-mid" style="color: #888;">{:lang('USD/Month')}</div>
            </div>
          </div>
        <div class="layui-form-item">
            <div class="layui-input-block layui-btn-block">
                <button type="button" class="layui-btn" lay-submit="" lay-filter="submit">{:lang('Submit')}</button>
            </div>
        </div>
    </form>
  </div>
</div>
{/block}
{block name="footer"}
<script>
    var m = angular.module('hd',[]);
    m.controller('ctrl',['$scope',function($scope) {
        //$scope.field = '{$info}'!='null'?{$info}:{name:''};
        layui.use(['form', 'layer'], function () {
            var form = layui.form, layer = layui.layer,$= layui.jquery;
            form.on('submit(submit)', function (data) {
                loading = layer.load(1,{shade:[0.1,'#fff']});
                // 提交到方法 默认为本身
                //data.field.id = $scope.field.id;
                $.post("", data.field, function (res) {
                    layer.close(loading);
                    if (res.code > 0) {
                        layer.msg(res.msg, {time: 1800, icon: 1}, function () {
                            top.location.reload();
                        });
                    } else {
                        layer.msg(res.msg, {time: 1800, icon: 2});
                    }
                });
            })
        });
    }]);
</script>
{/block}